<!DOCTYPE html>
<html lang="en" style="height:100%">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>新增关注</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css" />
    <!-- <link rel="stylesheet" href="../../css/BarlowCondensed-Bold.woff.ttf" /> -->
    <!-- <link rel="stylesheet" href="../../css/sqc.css"> -->
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        input{

            outline:none;
        }

    </style>
</head>

<body style="background: #fff;">
<div id="blank" class="header" v-cloak style="border-bottom: 1px solid #f7f4f2;">
    <div v-back.tapmode class="back"></div>
    <div class="title">新增关注</div>
</div>
<div id="app"  v-cloak style="padding-top:60px;">
    <div class="blacklist-people">
        <ul>
            <li v-for="(list,index) in follow_list">
                <div class="blacklist-head">
                    <img :src="list.member_avatar">
                </div>
                <div class="blacklist-head-datas">
                    <span class="blacklist-title" style="font-size: 15px;margin-bottom: 2px;">{{list.nickname}}</span>
                    <div class="blacklist-title" style="font-size: 12px;color: #999;">
                        {{list.create_time}}
                    </div>
                    <div class="recovery" :class="{'active_style' : list.attention_flag != 1}" style="font-size: 12px;" v-myclick="[index,add_follow]">
                        {{list.attention_flag == 1 ? '互相关注' : '回粉'}}
                    </div>
                </div>
            </li>
        </ul>
        <div v-if="follow_list.length <= 0" style="text-align:center;margin-top:50px">
            <img src="../../image/big/fensi.png" style="margin:0 auto;width:25%">
            <div style="margin:0 auto;color:#999999;text-align:center;padding-top:20px;font-size:12px">还没有收到新的关注</div>
        </div>
    </div>
</div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script src="../../script/components.js"></script>
<script type="text/javascript" src="../../script/jquery.js"></script>

<script>
    var vm,
        wx,
        follow_list,
    apiready = function () {
        setBSImg();
        new Vue({
            el: '#blank'
        })
        wx = api.require('wx');
        var data = {
            member_id:getPrefs('member_id'),
            page_no:1,
            page_size:20,
        };
        var callback = function (ret) {
            follow_list = ret.content;
            console.log(JSON.stringify(follow_list))
            initApp();
        };
        pinet.post(APIURL+'/app/Notices/newAttentionList', data, callback);
        api.parseTapmode();
        addListeners();
    };

    function initApp() {
        // var isBigImg = Vue.BSImg == 'big';
        vm = new Vue({
            el: '#app',
            data: {
                follow_list:follow_list,
            },
            computed: {

            },
            methods: {
                add_follow:function (value) {
                    console.log(vm.follow_list[value].member_id)
                    var data = {
                        member_id: getPrefs('member_id'),
                        attention_member_id: vm.follow_list[value].member_id,
                    };
                    var callback = function (ret) {
                        api.toast({
                            msg: ret.message,
                            duration: 2000,
                            location: 'middle'
                        });
                        vm.follow_list[value].attention_flag = vm.follow_list[value].attention_flag==1?0:1
                    };
                    pinet.post(APIURL+'/app/dynamic/attention', data, callback);
                }
            },
            watch: {

            },
        })
    }
    function addListeners() {

        api.addEventListener({
            name: 'viewappear'
        }, function () {
        });

        api.addEventListener({
            name: 'viewdisappear'
        }, function () {
        });

        api.addEventListener({
            name: 'keyback'
        }, function () {
            console.log('ddddd');
            api.closeWin();
        });
        api.addEventListener({
            name: 'reload'
        }, function () {
            window.location.reload();
        });
    }

</script>

</html>
